package com.cetc.cloud.kmga.scala

object Helper {

  def main(args: Array[String]): Unit = {
    List("1", "2", "3").productIterator.foreach(x => println(x))
    println(List("1", "2", "3").productArity)
    println("--------------")
    Tuple4(1,2,3,4).productIterator.foreach(x => println(x))
  }

  def toProduct(src : java.util.List[String]) = new Product {

    override def productElement(n: Int): Any = src.get(n)

    override def productArity: Int = src.size()

    override def canEqual(that: Any): Boolean = this == that
  }
}
